package com.dep.dto.req;

import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import org.hibernate.validator.constraints.Length;
import org.hibernate.validator.constraints.Range;

import javax.validation.constraints.NotBlank;
import javax.validation.constraints.NotNull;
import javax.validation.constraints.Pattern;
import java.io.Serializable;

@Data
public class StaffInsertReq implements Serializable {

    @ApiModelProperty(value = "编号",required = true)
    @NotBlank(message = "编号不能为空")
    @Pattern(regexp = "^[\\u4e00-\\u9fa5a-zA-Z0-9]{0,}$",message = "编号不支持特殊字符")
    @Length(max = 20,message = "编号长度过长,不能超过20个字符")
    private String staffNo;

    @ApiModelProperty(value = "姓名",required = true)
    @NotBlank(message = "姓名不能为空")
    @Pattern(regexp = "^[\\u4e00-\\u9fa5a-zA-Z0-9]{0,}$",message = "姓名不支持特殊字符")
    @Length(max = 20,message = "姓名长度过长,不能超过20个字符")
    private String staffName;

    @ApiModelProperty(value = "部门id",required = true)
    @NotNull(message = "部门id不能为空")
    private Long depId;

    @ApiModelProperty(value = "入职时间 yyyy-MM-dd HH:mm:ss",required = true)
    @Pattern(regexp = "^$|^(19|20)\\d{2}\\-[01]\\d\\-[0123]\\d\\s\\d{2}\\:\\d{2}\\:\\d{2}$", message = "日期格式不正确，如yyyy-MM-dd HH:mm:ss")
    @NotBlank(message = "入职时间不能为空")
    private String lnductionAtStr;

    @ApiModelProperty(value = "-1-离职, 0-实习, 1-试用, 2-正式",required = true)
    @Range(min = -1, max = 2,message = "员工状态不正确")
    @NotNull(message = "员工状态不能为空")
    private Byte staffStatus;
}
